<template name="buttom-bar">
    <view class="container">
        <view class="home">
            <u-image :src="homeIcon" @click="go('pages/index/index', 1)" width="50rpx" height="50rpx"></u-image>
        </view>
        <view class="user">
            <u-image :src="userIcon" @click="go('pages/user/index', 2)" width="50rpx" height="50rpx"></u-image>
        </view>
    </view>
</template>
<script>
export default {
    name: "buttom-bar",
    props: {
        homeIcon:{
            type: String
        },
        userIcon:{
            type: String
        },
        index: {
            type: Number
        }
    },
    methods: {
        go(path, index) {
            if (index == this.index) {
                return
            }
            uni.$u.route({
                url: path,
                type: "redirect"
            })
        }
    }
}
</script>
<style lang="scss" scoped>
    .container {
        box-sizing: border-box;
        width: 100%;
        height: 100rpx;
        background: #FFFFFF;
        box-shadow: inset 0px 1px 0px 0px #F0F0F0;
        display: flex;
        align-items: center;
        justify-content: center;
        .home {
            margin-right: 173rpx;
        }
    }
</style>
